#!/bin/bash

cur_dir="$( cd "$( dirname "$0"  )" && pwd  )"
mid_dir="/poker/logs/"
dir=$cur_dir$mid_dir


date=`date +%Y-%m-%d`

targets=(
auth_1
gate_1
gate_2
gate_3
gate_4
game_1 
global
)

types=(
debug
error
info
)

for target in ${targets[*]}
do
	if [  -d $dir$target ]; then
		cd $dir$target

		for type in ${types[*]}
		do

			if [  -f $type.log ]; then
				cat $type.log >> $type.$date.log	
				cat /dev/null > $type.log
			fi
		done
	fi
done


# echo "59 23 * * * root /root/core/cut_log.sh" >> /etc/crontab